with Ada.Containers.Vectors;

with Ada.Strings.Bounded;

with Ada.Text_IO;

with App_Configuration; use App_Configuration;

use Ada;

with Text_File_Reader;

--
-- file reader unit tests
--
--       test package supplying utility for reading file into a bounded string
--

package Test_Text_File_Reader is

   --
   -- run all tests
   --

   procedure Tests_Suite;


private

   --
   -- number of files supplied for testing file reader
   --

   COUNT_TEST_FILES_FOR_READER : constant := 4;

   FILE_NAMES_LISTING : constant String := "test_file_reader_filenames.txt";

   File_Names_Listing_Input : Text_IO.File_Type;


   --
   -- file reader instance
   --

   package File_Util is new Text_File_Reader( Max_Heap_Size  => HEAP_LIMIT,
                                              Max_Stack_Size => STACK_LIMIT );

   use File_Util;


   --
   -- collection of filenames for tests
   --
   --       vector collection usage for the several test file names
   --

   package File_Name_Bound_Type is new Strings.Bounded

         .Generic_Bounded_Length( FILE_NAME_LEN_LIMIT );

   subtype File_Name_Bound_Sub_Type is File_Name_Bound_Type.Bounded_String;

   function "=" ( This : in File_Name_Bound_Sub_Type;
                  That : in File_Name_Bound_Sub_Type ) return Boolean;

   subtype Test_File_Index is Positive range 1 .. COUNT_TEST_FILES_FOR_READER;

   package Test_Files_Vector_Type is new Ada.Containers.Vectors

         ( Index_Type      => Test_File_Index,

           Element_Type    => File_Name_Bound_Sub_Type );

   Test_Files_Vector : Test_Files_Vector_Type.Vector;


   --
   -- populate vector collection list of test file names
   --

   procedure Get_List_Test_File_Names;


   --
   -- test read of text file into string, preserving any /n and /r
   --

   procedure Test_Read_Into_String;


end Test_Text_File_Reader;